package com.example.mybatis.sqlserver.springbootmybatissqlserver.util;

/**
 * Created by hzy on 2019/2/20.
 */

public class BaseConstants {
    //分页查询时的默认页码
    public static final int DEFAULT_PAGE_NUMBER = 1;
    //分页查询是默认的每页结果数量
    public static final int DEFAULT_PAGE_SIZE = 20;

    public static class RespMsg {
        public static final String SUCCESS = "成功!";
        public static final String FAILED = "失败!";

        //region 接口不存在,变更,禁用等问题

        //接口暂不支持访问
        public static final String ACCESS_DENIED_INTERFACE_TEMPORARILY_DISABLED = "接口暂不支持访问"; // 接口临时失效
        //接口永久禁用
        public static final String ACCESS_DENIED_INTERFACE_PERMANENTLY_DISABLED = "接口永久失效"; // 接口永久失效
        public static final String REQUEST_INTERFACE_NOT_FOUND = "接口或页面不存在"; // 请求接口或页面不存在
        //endregion

        //region 服务器错误
        public static final String INTERNAL_SERVER_ERROR = "服务器内部异常";
        //endregion

        //region 参数校验等问题
        public static final String REQUEST_PARAM_INVALIDATION_FAILED = "参数校验错误";
        //endregion

        // region 用户验证相关
        public static final String ACCESS_DENIED = "您无权限访问该接口"; //用于用户权限不足的情况
        //失效的token
        public static final String TOKEN_INVALID = "请登录";//Access token invalid!
        public static final String ACCESS_DENIED_USER_WAS_DISABLED = "用户被禁用"; // 用户被禁用
        //endregion

        // region 用户模块
        public static final String USER_NAME_REPETITION = "用户名已存在";
        public static final String USER_NOT_EXISTS = "用户不存在";
        public static final String USER_PASSWORD_INVALID = "密码错误!"; // 无效的密码
        //endregion
    }

    public static class RespCode {
        public static final int SUCCESS = 0;
        public static final int FAILED = -1;

        //region 接口不存在,变更,禁用,请求不支持等问题
        //接口暂不支持访问
        public static final int ACCESS_DENIED_INTERFACE_TEMPORARILY_DISABLED = 301; // 接口临时失效
        //接口永久禁用
        public static final int ACCESS_DENIED_INTERFACE_PERMANENTLY_DISABLED = 302; // 接口永久失效
        //HTTP 请求方法不支持
        public static final int REQUEST_METHOD_NOT_SUPPORTED = 303; // 请求方法不支持
        // 接口不存在
        public static final int REQUEST_INTERFACE_NOT_FOUND = 404; // 请求接口或页面不存在
        //endregion


        //region 服务器错误
        public static final int INTERNAL_SERVER_ERROR = 500;
        //endregion


        //region 用户身份验证等问题
        //失效的token
        public static final int TOKEN_INVALID = 101;
        //服务端拒绝访问(权限问题)
        public static final int ACCESS_DENIED = 102; // 用户无权访问该接口
        //endregion


        //region 200 ~ 299 : 请求参数校验等问题
        public static final int REQUEST_PARAM_INVALIDATION_FAILED = 201; // 参数校验错误
        //endregion


    }
}
